package kr.hkit.powerjava.chapter12.pro;

import java.util.Arrays;

public class PersonTest {
	public static void main(String[] args) {
		Person[] arr = new Person[3];
		arr[0] = new Person("김태희", 160);
		arr[1] = new Person("전지현", 170);
		arr[2] = new Person("태연", 140);
		
		prnArr(arr);
		System.out.println("키가 가장 큰 사람은" + getMaximum(arr));
	}
	
	private static void prnArr(Person[] arr) {
		for(Person p : arr){
			System.out.println(p);
		}
	}

	public static int getMaximum(Person[] array){
		
		Arrays.sort(array);
		prnArr(array);
		return array[array.length-1].getHeight();
	}
}
